<template>
  <div id="mydiv">
      <h1>个人信息</h1>
      <div>
          <span>姓名:</span><span>{{myMessage.name}}</span>
      </div>
        <div>
          <span>员工编号:</span><span>{{myMessage.number}}</span>
      </div>
      <div>
          <span>性别:</span><span>{{sex}}</span>
      </div>
       <div>
          <span>部门:</span><span>{{myMessage.store_name}}</span>
      </div>
      <div>
          <span>职位:</span><span>{{myMessage.job_name}}</span>
      </div>
      <div>
          <span>联系电话:</span><span>{{myMessage.tel}}</span>
      </div>
  </div>
</template>

<script>
import {mapActions,mapState} from 'vuex'
export default {
    name:'grxx',
    created(){
        this.getPersonMsg(sessionStorage.getItem('number'))
    },
    methods:{
        ...mapActions(['getPersonMsg'])
    },
    computed:{
        ...mapState({
            myMessage:state=>state.grxx.personMsg
        }),
        sex(){
            if (this.myMessage.sex==1) {
                return '男'
            }else{
                return '女'
            }
        }
    }
}
</script>

<style lang="less" scoped>
    #mydiv>div{
        padding: 20px;
        margin-left: 38%;
    }
    #mydiv{
        text-align: left;
    }
    h1{
        text-align: center;
        font-size: 40px;
    }
    span{
        display: inline-block;
        margin:0 5px;
        font-size: 30px;
    }
</style>
